cmake_minimum_required(VERSION 3.10)
project(glinux-vc)

# 设置搜索.cmake文件的路径, 方便调用include
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

# 初始化工程
include(nxproject_aux) 
nxproject_init()

# 检查是否为Debug构建
# message(STATUS "Build Type = ${CMAKE_BUILD_TYPE}")
# if(CMAKE_BUILD_TYPE STREQUAL "Debug")
#     # 是Debug构建，可以在这里设置编译选项，例如：
#     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -g -DDEBUG -D_DEBUG")
#     # # 或者定义宏
#     # add_definitions(-DDEBUG)
#     # 其他Debug下的设置...
# else()
#     # 非Debug构建，可以在这里设置编译选项，例如：
#     set(CMAKE_CXX_FLAGS_RELEASE "$<CMAKE_CXX_FLAGS_RELEASE> -O3 -DNDEBUG")
#     # # 或者定义宏
#     # add_definitions(-DNDEBUG)
#     # 其他Release下的设置...
# endif()

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

include_directories(
    ${CMAKE_SOURCE_DIR}/src
    /usr/include/x86_64-linux-gnu
    /usr/include/x86_64-linux-gnu/c++/13
    /usr/local/include/wine
    /usr/local/include/wine/windows
    /usr/local/include/wine/msvcrt
    /usr/include
    /usr/include/c++/13
)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MMD -MP")

add_definitions(-D_MSVCR_VER=0 -D__WINESRC__ -DWINBASEAPI= -DWINADVAPI= -DWINUSERAPI= -DWINSHLWAPI= -Wall -pipe)
add_definitions(
 	-D_GLIBCXX_USE_C99_DYNAMIC
 	-D_GLIBCXX_HAVE_WCHAR_H #定义wchar_t
 	-DNOMINMAX #防止定义min和max宏
# 	-D
 	)

# add_subdirectory(src)
add_executable(winetest1 src/testspace/main.cpp)  # 替换为你的源文件路径

target_link_libraries(winetest1 wine winecrt0 user32 kernel32)